const mysql = require('mysql');

const connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: 'root',
    database: 'jy',
    port: 3306,
    charset: 'UTF8_GENERAL_CI',
    timezone: '+08:00'
});

connection.connect((err) => {
    if (err) {
        console.error('数据库连接失败：', err);
        return;
    }
    console.log('数据库连接成功！');
});

// 导出数据库连接
module.exports = connection; 